<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script type="text/javascript">
    $(function () {
        find_phone('1')
        $(".combo-text").blur(function () {
            var val=$(this).val()==""?"1":$(this).val();
            find_phone(val)
        })
    })
    function transmit_by_radio(){
        var phone=$("input[name='phone']").val()
        if(isNaN(phone) || phone.length!=11) {
            $.messager.show({
                title : '提示',
                msg : '手机号格式不正确！'
            });
            return false;
        }
        var txt=$("#txt").val();
        if ($.trim(txt)=="") {
            $.messager.show({
                title : '提示',
                msg : '请输入短信内容！'
            });
            return false
        }
        $.post("${pageContext.request.contextPath}/memberController/transmit_by_radio.action",{id:phone,name:txt}, function (result) {
            var data=JSON.parse(result);
            if (data["obj"]=="1"){
                $.messager.show({
                    title : '提示',
                    msg : '发送成功！'
                });
            }else{
                $.messager.show({
                    title : '提示',
                    msg : '发送失败！'
                });
            }
        })
    }
    function find_phone(str){
        $('#demoCombo').combobox({
            url:'${pageContext.request.contextPath}/memberController/find_phone1.action?str='+str,
            valueField:'id',
            textField:'text',
        });
    }
</script>
<div style="margin-top: 50px;margin-left: 50px;">

    <div style="font-size: 16px">编写短信内容:<br><br>手机号:<select id="demoCombo" class="easyui-combobox" name="phone" style="width:200px;"></select><br><br></div>

    <div>
        <textarea rows="5" cols="50" name="txt" id="txt"></textarea>
    </div><br>
    <div>
        <a onclick="javascript:transmit_by_radio()" class="easyui-linkbutton l-btn" data-options="iconCls:'icon-redo'"><span>点击发送</span></a>
    </div>
</div>